package com.lnsf.bookstore.system.booksSpecification.service.impl;

import com.github.pagehelper.PageInfo;
import com.lnsf.bookstore.system.booksSpecification.service.BooksSpecificationService;
import com.lnsf.bookstore.system.booksSpecification.dao.BooksSpecificationMapper;
import com.lnsf.bookstore.system.booksSpecification.vo.BooksSpecification;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class BooksSpecificationServiceImpl implements BooksSpecificationService {

    @Autowired
    private BooksSpecificationMapper booksSpecificationMapper;


    @Override
    public int save(BooksSpecification booksSpecification) {
        return booksSpecificationMapper.insertSelective(booksSpecification);
    }

    @Override
    public BooksSpecification queryObject(Integer id) {
        return booksSpecificationMapper.queryObject(id);
    }

    @Override
    public int deleteBatch(Integer[] ids) {
        return booksSpecificationMapper.deleteBatch(ids);
    }

    @Override
    public int update(BooksSpecification booksSpecification) {
        return booksSpecificationMapper.updateByPrimaryKeySelective(booksSpecification);
    }

    @Override
    public PageInfo<BooksSpecification> queryList(Map<String, Object> params) {
        return new PageInfo<BooksSpecification>(booksSpecificationMapper.queryList(params));
    }
}
